{% extends "base.html" %} {% block title %}首页 - 运动健康管理系统{% endblock %}
{% block content %}
<div class="container py-5">
  <div class="row mb-5">
    <div class="col-md-12 text-center">
      <h1 class="display-4 fw-bold">欢迎使用KeepRun</h1>

      {% if current_user.is_authenticated %}
      <p class="lead mt-3">
        您好，{{ current_user.username }}！欢迎回来。 {% if
        current_user.is_admin %}
        <a href="{{ url_for('admin_dashboard') }}" class="btn btn-primary mt-2"
          >进入管理员控制台</a
        >
        {% endif %}
      </p>
      <div class="row mt-5">
        <div class="col-md-3 mb-4">
          <div class="card h-100 shadow-sm">
            <div class="card-body text-center">
              <i class="bi bi-person-circle fs-1 text-primary mb-3"></i>
              <h5 class="card-title">个人信息</h5>
              <p class="card-text">查看和管理您的个人健康信息</p>
              <a
                href="{{ url_for('user_info') }}"
                class="btn btn-outline-primary"
                >进入</a
              >
            </div>
          </div>
        </div>

        <!-- 其他普通用户功能卡片 -->
        <div class="col-md-3 mb-4">
          <div class="card h-100 shadow-sm">
            <div class="card-body text-center">
              <i class="bi bi-clipboard2-pulse fs-1 text-success mb-3"></i>
              <h5 class="card-title">健康计划</h5>
              <p class="card-text">获取个性化的健康计划推荐</p>
              <a
                href="{{ url_for('health_plan') }}"
                class="btn btn-outline-success"
                >进入</a
              >
            </div>
          </div>
        </div>

        <div class="col-md-3 mb-4">
          <div class="card h-100 shadow-sm">
            <div class="card-body text-center">
              <i class="bi bi-egg-fried fs-1 text-warning mb-3"></i>
              <h5 class="card-title">健康知识</h5>
              <p class="card-text">浏览健康知识</p>
              <a
                href="{{ url_for('health_knowledge') }}"
                class="btn btn-outline-warning"
                >进入</a
              >
            </div>
          </div>
        </div>

        <div class="col-md-3 mb-4">
          <div class="card h-100 shadow-sm">
            <div class="card-body text-center">
              <i class="bi bi-people fs-1 text-info mb-3"></i>
              <h5 class="card-title">社区交流</h5>
              <p class="card-text">与其他用户分享经验和心得</p>
              <a href="{{ url_for('community') }}" class="btn btn-outline-info"
                >进入</a
              >
            </div>
          </div>
        </div>
      </div>
      {% else %}
      <!-- 未登录用户看到的内容 -->
      <p class="lead mt-3">您的个人健康管理助手</p>
      <div class="mt-4">
        <a href="{{ url_for('login') }}" class="btn btn-primary me-2">登录</a>
        <a href="{{ url_for('register') }}" class="btn btn-outline-primary"
          >注册</a
        >
      </div>

      <div class="row mt-5">
        <div class="col-md-4 mb-4">
          <div class="card h-100 shadow-sm">
            <div class="card-body text-center">
              <i class="bi bi-clipboard2-pulse fs-1 text-primary mb-3"></i>
              <h5 class="card-title">个性化健康计划</h5>
              <p class="card-text">
                根据您的身体状况和目标，为您定制专属健康计划
              </p>
            </div>
          </div>
        </div>

        <div class="col-md-4 mb-4">
          <div class="card h-100 shadow-sm">
            <div class="card-body text-center">
              <i class="bi bi-egg-fried fs-1 text-success mb-3"></i>
              <h5 class="card-title">健康饮食指导</h5>
              <p class="card-text">提供科学的饮食建议和健康食谱推荐</p>
            </div>
          </div>
        </div>

        <div class="col-md-4 mb-4">
          <div class="card h-100 shadow-sm">
            <div class="card-body text-center">
              <i class="bi bi-people fs-1 text-info mb-3"></i>
              <h5 class="card-title">社区互动</h5>
              <p class="card-text">与志同道合的朋友分享健康生活经验</p>
            </div>
          </div>
        </div>
      </div>
      {% endif %}
    </div>
  </div>
</div>
{% endblock %}
